#include <string>
#include <boost/any.hpp>
#include "any.h"

class Data
{
public:
	Data ( const char * str )
		:str_(str)
	{
		printf ( "contruct: %s\n", str_.c_str() ) ;
	}

	~Data ( void )
	{
		printf ( "destruct: %s\n", str_.c_str() ) ;
	}

private:
	std::string		str_ ;
};


int main ( int argc, char* argv[] )
{
	any Test = 100 ;

	Test = 100 ;
	Test = new Data("Data1") ;
	Test = Data("Data2") ;

	printf ( "Test: %s\n", Test.type().name() ) ;

//	any Str1 = std::string("100") ;
//	any Str2 = new std::string("100") ;

	Data * aaa = any_cast<Data*> ( Test ) ;
	aaa = any_cast<Data*> ( 100 ) ;

	return 0 ;
}